﻿using HeinQi.Framework.LayerBases;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TbShop.Business.Components
{
    public interface IBusinessContractBase<TEntityBase> where TEntityBase : EntityBase
    {
        TEntityBase Get(int id);

        TEntityBase Remove(TEntityBase item);

        void RemoveAll(IEnumerable<TEntityBase> items);

        void RemoveAll(IEnumerable<int> items);

        TEntityBase Save(TEntityBase item);

        IEnumerable<TEntityBase> GetAll(IOrderedQueryable<TEntityBase> models, int pageIndex, int pageSize, out int count);

        IEnumerable<TEntityBase> GetAll(IQueryable<TEntityBase> models, int pageIndex, int pageSize, out int count);

        IEnumerable<TEntityBase> GetAll(int pageIndex, int pageSize, out int count);

        IEnumerable<TEntityBase> SaveRange(IEnumerable<TEntityBase> list);
        int SaveChanges();
    }
}
